package com.geekhalo.admin.app.app.query;

import com.geekhalo.admin.domain.app.WebApplicationStatus;
import com.geekhalo.lego.annotation.singlequery.FieldEqualTo;
import com.geekhalo.lego.core.singlequery.Pageable;
import lombok.AccessLevel;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;

@NoArgsConstructor
@Data
public class PageByStatus{
    @FieldEqualTo("status")
    private WebApplicationStatus status;

    @Setter(AccessLevel.PRIVATE)
    private Pageable pageable = Pageable.builder().build();

    public void setCurrent(Integer current){
        pageable.setPageNo(current - 1);
    }

    public void setPageSize(Integer pageSize){
        pageable.setPageSize(pageSize);
    }
}
